<?php
include "../../../lib/list.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head>
<link rel="stylesheet" href="../../../css/insert.css" type="text/css"></link>
<link rel="stylesheet" href="../../../css/list.css" type="text/css"></link>
<script type="text/javascript" src="../../../js/list.js"></script>
<script>

function insert_submit(){
		document.insert.action = 'query.php';
		document.insert.target = 'right'; 
		document.insert.method = 'post';
		document.insert.submit();
}
</script>
</head>
<body>
	<div style="width: 1024px; padding: 10px;">
		<div style="border-bottom: 1px solid #e8e8e8; text-align: left; font-size: 12px; margin-bottom: 12px; color: #9a9a9a">:::
			기본 설정&nbsp;⇒&nbsp;관리자 마스터&nbsp;⇒&nbsp;관리자 추가하기</div>
		<form name="insert" method="post" action="query.php">
			<input type="hidden" value="0" name="sw" />
			<div id=register>

			<?php
			$table = "uniaimlogin";
			if($_POST['mode']=='modify'){
				$no = $_POST['chk_no'];
				for($i=0;$i<count($no);$i++){
					$qry  = "SELECT * from $table where no = $no[$i]";
					$list = MDBarray($qry);
					
					?>
 
				<!--   /////////////////////	  기존 내용 수정하기	 ///////////////////// -->
				<input type="hidden" name="no[]" value="<?=$no[$i]?>"/>
				<input type="hidden" value="modify" name="mode" />
				<ul class='line'></ul>
				<ul>
					<li class="lable">관리자이름</li>
					<li class='detail'><input type='text' size='20' name='name[]'
						value='<?=$list['name']?>' class='default'/>
					</li>
				</ul>
				<ul>
					<li class="lable">권한</li>
					<li class='detail'>
					<select name='authorize[]' style='font-size:11px'>
					<option value="0" <?if($list['authorize']==0)echo "selected";?>>변경</option>
					<option value="1" <?if($list['authorize']==1)echo "selected";?>>열람</option>
					</select>
					</li>
				</ul>
				<ul>
					<li class="lable">비고</li>
					<li class='detail'><input type='text' size='20' name='note[]'
						value='<?=$list['note']?>'  class='default'/>
					</li>
				</ul>
				<ul>
					<li class="lable">ID</li>
					<li class='detail'><?=$list['id']?>
					</li>
				</ul>
				<!--   /////////////////////	  기존 내용 수정하기	 ///////////////////// -->
			<?php
				}
				 }else{
			?>
			
			<!--   /////////////////////  새로운 내용 입력하는 부분    ///////////////////// -->
			<input type="hidden" value="insert" name="mode" />
			<ul class='line'></ul>
				<ul class='line'></ul>
				<ul class='line'></ul>
				<ul>
					<li class="lable">ID</li>
					<li class='value'><input type='text' size='20' name='id' readonly onclick="javascript:chk_id();" class='default'/>
					</li>
				</ul>
				<ul>
					<li class="lable">PASSWORD</li>
					<li class='value'><input type='password' size='20' name='passwd' onblur='char_check(this)' class='default'/>
					</li><li class='explain'>:: 4~15자 이내, 영문 숫자 혼용 사용</li>
				</ul>
				<ul>
					<li class="lable">PASS 확인</li>
					<li class='value'><input type='password' size='20' name='passwd2' onblur='pw_check()' class='default'/>
					</li><li class='explain'><input type='text' size='30' name='chk_pw' style='border:0px;font-size:11px;color:#8492A0' readonly value="* 비밀번호를 한번더 입력해주세요." /></li>
				</ul>	
				<ul>
					<li class="lable">관리자이름</li>
					<li class='detail'><input type='text' size='20' name='name'
						value='' class='default'/>
					</li>
				</ul>
				<ul>
					<li class="lable">권한</li>
					<li class='detail'>
						<select name='authorize' style='font-size:11px'>
						<option value="0">변경</option>
						<option value="1" selected>열람</option>
						</select>
					</li>
				</ul>
				<ul>
					<li class="lable">비고</li>
					<li class='detail'><input type='text' size='20' name='note'
						value=''  class='default'/>
					</li>
				</ul>
			<!--   /////////////////////  새로운 내용 입력하는 부분    ///////////////////// -->
		<?php }
		?>
		<ul class='line'></ul>
	</div>
			<div style="padding: 5px;">
				<center>
					<input type="button" class="button white small" value="입력하기" onclick="javascript:insert_submit();"/> <input
						type="button" class="button white small" value="취소하기"
						onclick="javacsript:history.go(-1)" />
				</center>
			</div>
		</form>
	</div>
</body>

</html>